package com.gitee.feizns.config.java;

import com.gitee.feizns.utils.StringUtils;
import lombok.Data;

/**
 * @author feizns
 * @since 2019/8/12
 */
@Data
public class PackageConfig {

    static PackageConfig DEFAULT = new PackageConfig("");

    /**
     * 前缀
     */
    private String prefix;

    /**
     * 控制器包名
     */
    private String controller = "web.controller";

    /**
     * 业务包
     */
    private String service = "service";

    /**
     * mapper
     */
    private String mapper = "mapper";

    /**
     * 实体包
     */
    private String pojo = "domain.pojo";

    /**
     * 接收对象
     */
    private String ao = "domain.ao";

    /**
     * 响应对象
     */
    private String vo = "domain.vo";


    public String getController() {
        return StringUtils.concat(".", prefix, controller);
    }

    public String getService() {
        return StringUtils.concat(".", prefix, service);
    }

    public String getMapper() {
        return StringUtils.concat(".", prefix, mapper);
    }

    public String getPojo() {
        return StringUtils.concat(".", prefix, pojo);
    }

    public String getAo() {
        return StringUtils.concat(".", prefix, ao);
    }

    public String getVo() {
        return StringUtils.concat(".", prefix, vo);
    }

    public PackageConfig(String prefix) {
        this.prefix = prefix;
    }

}
